package com.scs.application.modules.wm.controller;

import com.scs.application.core.mvc.controller.CrudController;
import com.scs.application.modules.sys.model.RestResult;
import com.scs.application.modules.wm.entity.TransferDemand;
import com.scs.application.modules.wm.service.TransferDemandService;
import com.scs.application.modules.wm.service.TransferItemService;
import com.scs.application.modules.wm.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 调拨需求单 前端控制器
 * </p>
 */
@RestController
@RequestMapping("/wm/transfer_demand")
public class TransferDemandController extends CrudController<TransferDemandService, TransferDemand> {

    @Autowired
    private TransferItemService transferItemService;

    @Autowired
    private TransferService transferService;

    @PostMapping("/addDtlBatch")
    public RestResult addDtlBatch(@Valid @RequestBody List<TransferDemand> entityList) {
        service.addDtlBatch(entityList);
        return RestResult.ok("批量添加成功", entityList);
    }
}
